<?

$holiday_values = explode("~", $_POST['search_string']);

	$hotelCode = $holiday_values[31];
	$duration = $holiday_values[14];
	$outDate = $holiday_values[7];
	$outDay = substr($holiday_values[7],4,2);
	$outMonth = substr($holiday_values[7],2,2);
	$outYear = substr($holiday_values[7],0,2);
	$outDepTime = $holiday_values[10]; 
	$outArrTime = $holiday_values[11]; 
	$outOrigin = $holiday_values[8];
	$outDestination = $holiday_values[9];
	$retDate = $holiday_values[12];
	$retDepTime = $holiday_values[21]; 
	$retArrTime = $holiday_values[22]; 
	$retDestination = $holiday_values[13];
	
	
	if(in_array($outMonth,array('12','01','02','03'))){
		$brochure_code = "SKI";
	}else{
		$brochure_code = "TFS";
	}
	
	$adults = $_POST['book_adults'];
	$childs = $_POST['book_child'];
	$infants = $_POST['book_infant'];

switch ($_POST['tour_operator']) {
	case "SWY";

header("Location: http://www.sunwayholidays.ie/olbs/passThruHandler.jsp?step=pkg_search&portalCode=lated&Referrer=lated%2F&PHGfrom=$outOrigin&hotelCode=$hotelCode&duration=$duration&OutDay=$outDay&OutMon=$outMonth&OutYear=$outYear&adults=$adults&childs=$childs&infants=$infants");	

	break;
	case "TFL";

header("Location:https://bookings.topflight.ie/olbs/WebResServlet?step=logon_pkgRoomsExtras&currency=euro&company=1&brochureCode=$brochure_code&hotelCode=$hotelCode&arrivalDate=$outDate&duration=$duration&outOrigin=$outOrigin&outDest=$outDestination&retOrigin=$outDestination&retDest=$retDestination&outNumber=&outDate=$outDate&outDepTime=$outDepTime&outArrTime=$outArrTime&retNumber=&retDate=$retDate&retDepTime=$retDepTime&retArrTime=$retArrTime&adults=$adults&childs=$childs&infants=$infants&brand=LAT");

	break;

}





  
  


?>